The present invention relates to a cache controlling method in a disk array. In particular, it relates to an efficient caching control in correspondence with the access of an application.
A magnetic disk device with a high cost performance is generally used as a device for storing computer data. The magnetic disk has a mechanism by which data is read and written by a plurality of magnetic disks about 2.5 or 3.5 inches in diameter and magnetic heads provided on the both sides of each magnetic disk.
The magnetic disk is accompanied by mechanical movements. Accordingly, its processing time is equal to about 10 m seconds, which is slow in comparison with the processing speed of a processor. There are many cases where, even if the processor is speeded up, no entire system performance is enhanced unless the magnetic disk is speeded up. In order to speed up the magnetic disk and solve this problem, a disk cache is generally used. As explained in xe2x80x9cUnderstanding I/O Subsystems First Editionxe2x80x9d, W. David Schwaderer, Andrew W. Wilson, Jr., pp. 253-261, the disk cache is the following speeding up system: Data stored in the magnetic disk (hereinafter, abbreviated as a drive) are stored into a high-speed semiconductor memory (the disk cache) provided within a controller for controlling the drive. Then, if data requested from a host exists in the disk cache, no access to the drive is executed and instead the data within the disk cache is transferred to the host, thereby speeding up the drive access. Also, at the time of writing data, the writing-completion notice is sent to the host at the time when the data from the host has been written into the disk cache. Moreover, when the disk controller is in an idle state or at a fixed interval, the data written into the cache is further written into a predetermined place in the drive. Also, in such cases as a sudden power-supply breakdown, the data is protected by a battery so that the data is not lost. The disk cache has an effect of speeding up both a data-writing process and a data-reading process. The disk cache, however, includes the semiconductor memory that is more expensive than the drive. As a result, it is impossible for the disk cache to store all the data within the drive. For example, as compared with an entire drive capacity of 700 GB, a capacity of the disk cache is equal to about 4 GB, which is only about 1% of the entire drive capacity. In a state where data have been already stored in all the areas of the disk cache, when further storing new data into the disk cache, it is requited to expel any of the data stored in the disk cache. When the expelling of the data has been completed, the data to be newly stored is written into the area from which the old data has been expelled. This operation is referred to as xe2x80x9ccache replacexe2x80x9d. As this cache replace method, FIFO (First In First Out) method and LRU (least recently used) method are explained in xe2x80x9cUnderstanding I/O Subsystems First Editionxe2x80x9d, W. David Schwaderer, Andrew W. Wilson, Jr., pp. 253-261. The FIFO method is a first-in first-out method by which the data are expelled in order from the oldest data. The FIFO has an effect in the case of an access characteristic that the data are accessed sequentially. The FIFO, however, is not suitable for a random access characteristic since the data are expelled regardless of a height of the access frequency. For example, even if there is contained data that is accessed frequently, all the data are expelled in order in the FIFO method. This condition reduces a possibility that the data accessed frequently still remains at the time of the next access. On account of this, the LRU method is often used for performing the cache control. The LRU is a method in which, when all the disk cache areas are already in use and it becomes required to assign any of the disk cache areas for the other data, a cache area having the lowest access frequency is reused and assigned first. Accordingly, in the LRU method, the data having a higher access frequency becomes likely to remain in the disk cache. This condition makes it possible to enhance a hit rate of the disk cache in comparison with the FIFO. In addition to the disk cache field, the LRU method is used over wide range of fields such as an instruction cache within the processor and a buffer control in the database system. The reason why the LRU is used widely is that the LRU allows the control corresponding to the access characteristic and results in a lower control overhead. The LRU method can be expected to exhibit an effect when the access to the cache has been stabilized. However, when the access to the cache is changed dynamically, the LRU method is unable to control the cache very well. This is due to the fact that, since the access characteristic is changed dynamically, a shift occurs between sampling of the access frequency and the control of the disk cache. In order to solve this problem, in JP-B-7-99508, there is disclosed a disk cache controlling method that is made possible to respond to and deal with the dynamical change by combining a steepest descent method with a disk cache miss rate function. The disk cache controlling method is a method in which, using the steepest descent method and the disk cache miss rate function, the area-dividing with which the disk cache is used is varied so that a disk cache miss rate becomes its minimum.
Meanwhile, other than the disk cache, a disk array can be mentioned as a member of speeding up the drive. As explained in xe2x80x9cUnderstanding I/O Subsystems First Editionxe2x80x9d, W. David Schwaderer, Andrew W. Wilson, Jr., pp. 271-291, the disk array is the following system: Data are located in a plurality of drives in a distributed manner, and at the same time the redundant data are also stored in the drives, thereby enhancing the performance and the reliability. The disk array is used in a large-scale system, because all the requested drive capacity becomes larger and the performance and the reliability are requested simultaneously. The use of the disk array has enhanced the capacity, the performance, and the reliability. This has increased an access case where a large number of application programs are concentrated on a single disk array controller. In this case, it turns out that a single disk cache area is used in a competitive manner by the plurality of applications.
The LRU method, which is employed at present as a standard method of performing the cache control, uses only the access frequency for the cache control. As a result, in such an environment that the disk array is used, i.e., a plurality of applications operate in a multiplexed manner, the LRU method is unable to perform the efficient cache control. For example, assume the following case: There exist two JOBs having different access characteristics, and JOB 1 accesses local disk areas and JOB 2 accesses wide range of disk areas, and their access frequencies are equal to each other. In this case, because of the same access frequencies, the LRU method assigns almost the same disk cache area to the two JOBs. The JOB 2, however, accesses the wide range of disk areas. This condition lowers an enhancement rate of the hit rate even if the disk cache area is assigned, thus resulting in an inefficient cache control as a whole. Also, the disk cache controlling method disclosed in JP-B-7-99508 is able to respond to and deal with, to a certain extent, the case such as the disk array where a plurality of applications operate simultaneously. In the controlling method, a disk cache area is divided into a plurality of cache pools, and a size of each cache pool is adjusted using the disk cache miss rate function and the steepest descent method so that the miss rate becomes small, thereby enhancing the disk cache hit rate. In the disk cache controlling method disclosed in JP-B-7-99508, the cache is increased or decreased in a unit of the cache pool having a large capacity. When a plurality of applications use the same cache pool simultaneously, the large management unit averages accesses from the plurality of applications, thereby making it impossible to detect the exact access characteristics. For example, in cases where applications making a local access and applications making a wide range of access are mixed together, the accesses are averaged. This condition causes a control to be performed that is the same as the control of an intermediate range of access, thus resulting in a problem that the optimum cache control becomes impossible. Also, the size-adjustment of each cache pool necessitates the number of the operations that is proportional to the square of the number of the cache pools. This gives rise to a problem that the overhead is increased to such an extent that the disk cache capacity and the disk system become large-scaled. Also, there exists a problem that it is impossible to follow and deal with a sudden change of an access. For example, when an access to a cache pool having an exceedingly high hit rate is suspended on account of reasons such as termination of the application, it is not so easy to perform a control of depriving the area. This is due to the fact that, since the disk cache controlling method is based on a change in the miss rate, it is difficult to accurately grasp a time change in the access characteristic in the case where there occurs no change in the miss rate.
In the present invention, in order to solve the above-described problems, the following control is performed: The distribution of an access frequency is detected. Then, the control is performed so that more of cache areas are assigned to a volume where the distribution of the access frequency is localized. Conversely, in the case of a volume where the access frequency is distributed over a wide range, the control is performed so that no cache area is assigned thereto. Concretely speaking, there is provided a member of dividing the area of a volume into areas having an arbitrary fixed length, and determining the access frequencies for the respective divided areas, and depriving at first, with the highest priority, the cache area in which the area having the lowest access frequency is stored.